package com.apetrenko.avaya.callstore.server;

import com.apetrenko.avaya.callstore.client.Record;
import com.apetrenko.avaya.callstore.client.RecordsService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class RecordsServiceImpl extends RemoteServiceServlet implements
		RecordsService {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2425046931346349306L;

	@Override
	public Record[] getRecords(long aSessionId) {
		Record[] vResult = {};
		
		DbAdapter vAdapter = (DbAdapter) this.getServletContext().getAttribute(ContextListener.ATTR_DBADAPTER);
		
		if (vAdapter == null){
			return vResult;
		}
		
		vResult = vAdapter.getRecords(null);
		return vResult;
	}

}
